// 两数之和

let nums = [2,7,11,15], target = 9

var twoSum = function(nums, target) {
let flag = 0, map = {}
for(let i = 0; i < nums.length; i++) {
    flag = k - nums[i]

    if(map.get(flag) !== undefined) {
        return [map.get(flag), i]
    }
    map.set(flag, i)
}
}